#!/bin/bash
# data preprocess in all
# prerequisite:
#           pre_data/filedType.txt
#           pre_data/training.txt
#           pre_data/validation.txt

# 1.remove columns:6,18,51,52,55,413-415,435-437,470,474(total:13)
cat ../../pre_data/training.txt | cut -f \
1-5,7-17,19-50,53-54,56-412,416-434,438-469,471-473,475- -d  \
,> ../../data/training.txt

cat ../../pre_data/validation.txt | cut -f \
1-5,7-17,19-50,53-54,56-412,416-434,438-469,471-473,475- -d  \
,> ../../data/validation.txt

# 2.split training.txt to two parts:training data and test data
python ../python/Res00_split_1_3.py

# 3.discrete training data
python ../python/Res01.py

# 4.split discreted training data to two parts:respond and not_respond
python ../python/Res02_split.py

# 5.select most valuable attributes and boolen respond data 
python ../python/Res03_bit.py

# 6.use index file produced by step 5 to boolen test data
python ../python/Res04_bit_test.py

# 7.use index file produced by step 5 to boolen all training data
python ../python/Res05_bit_rt.py

# 8.use index file produced by setp5 to boolen validation data
python ../python/Res06_bit_validation.py

# 9.compare predict result with actual result of test data
python ../python/statistic.py

# 10.USEAGE:
#     ../../fptree/fp      # produce rules
#     ../../model/model    # construct classify model and predict test/validation data